import request from '@/utils/request'

// 获取经纪列表
export function getAgentsList(params) {
  return request({
    url: '/agents',
    method: 'get',
    params
  })
}
// 新增经纪列表
export function addAgents(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}

// 删除经纪
export function delAgents(id) {
  return request({
    url: '/agents/' + id,
    method: 'delete'
  })
}

// 获取指定经纪
export function getAgentsId(id) {
  return request({
    url: '/agents/' + id,
    method: 'get'
  })
}

// 编辑经纪
export function editAgentsId(data) {
  return request({
    url: `/agents/${data.id}`,
    method: 'put',
    data
  })
}

// 获取模糊搜索的经纪列表
export function getSearchId(params) {
  return request({
    url: `/agents/count`,
    method: 'get',
    params
  })
}
